package Lock;

//只给出要修改的代码，其余代码与上同
class Bank3 {
    //需要同步的变量加上volatile
    private volatile int account = 100;

    public int getAccount() {
        return account;
    }

    //这里不再需要synchronized
    public void save(int money) {
        account += money;
    }
}